
<link  href="/stylesheets/tests.css" type="text/css" rel="stylesheet" media="screen">
<p style="margin: 5px 0pt;"><%=link_to  '测试管理' , :controller=>"surveys" ,:action=>"index"%> >>
<%=link_to '倾向测试管理' ,:controller=>"t_tests_manage" , :action=>"index"%> 
</p><br  />
<table class="datalist">
  <caption>
    测试管理
  </caption>
  <tr>
    <th scope="col" width="150">测试</th>
    <th scope="col" width="300">说明</th>
    <th scope="col">测试类型</th>
    <th scope="col">结果（倾向）数量</th>
    <th scope="col">题目数量</th>
    <th colspan="5" scope="col"></th>
  </tr>
  <%   i = 0  
    @tests.each do |test| 
  %>
    <% if i%2 == 0 %>
  <tr>
    <% else %>
  <tr  class="altrow">    
    <% end %>
    <%if test.t_type==TEST_TYPE_TREND %>
    <td><%=h test.name %></td>
    <td><%=h truncate(test.description, 80) %></td>
    <td><%=h test.t_type %></td>
    <td><%= test.trend_scales.size %></td>
    <td><%= test.questions.size %></td>
    <td><%= link_to '添加结果（倾向）', {:id => test, :action => :new_trend_scale }%></td>
    <td><%= link_to '添加题目', {:id => test, :action => :new_question }%></td>
    <td><%= link_to '查看' %></td>
    <td><%= link_to '修改', edit_test_path(test) %></td>
    <td><%= link_to '删除', {:id => test, :action => :destroy}, :confirm => '确定删除?'  %></td>
  </tr>
  <% end %>
  <% 
    i += 1
    end 
  %>

</table>
<br/>
<%= link_to '创建测试', :controller => "t_tests_manage", :action => "new" %>
